package com.neusoft.neuiotms.dcam.fixed.service;

import java.io.InputStream;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import com.neusoft.bizcore.auth.common.bean.UserBean;
import com.neusoft.bizcore.web.support.Searchable;
import com.neusoft.neuiotms.dcam.fixed.dto.AssetDTO;

public interface AssetService {

    List<AssetDTO> index(Searchable searchable);

    long count(Searchable searchable);

    Page<AssetDTO> search(Pageable pageable, Searchable searchable);

    Page<AssetDTO> search(Pageable pageable, Searchable searchable, UserBean userBean);

    Page<AssetDTO> searchBind(Pageable pageable, Searchable searchable, UserBean userBean);

    Page<AssetDTO> searchNoBind(Pageable pageable, Searchable searchable, UserBean userBean);

    Page<AssetDTO> mySearch(Pageable pageable, Searchable searchable, UserBean userBean);

    AssetDTO create(AssetDTO dto, final HttpServletRequest request, UserBean user);

    AssetDTO update(Long id, AssetDTO dto);

    AssetDTO details(Long id);

    AssetDTO detailsByCode(String code);

    void delete(Long id, final HttpServletRequest request, UserBean user);

    /**
     * 固定资产/低值易耗品模板
     *
     * @param belongs
     * @return
     */
    Workbook template(String belongs);

    /**
     * 消耗品模板
     *
     * @param belongs
     * @return
     */
    Workbook xhTemplate(String belongs);

    void upload(InputStream fileStream, String belongs, String categories, String username);

    void xhUpload(InputStream fileStream, String belongs, String categories, String username);

    /**
     * 导出固定资产/低值易耗品
     *
     * @param belongs
     * @return
     */
    Workbook export(Searchable searchable, Pageable pageable, String belongs, String categories, String id);

    /**
     * 导出消耗品
     *
     * @param belongs
     * @return
     */
    Workbook xhExport(Searchable searchable, Pageable pageable, String belongs, String categories, String id);

    /**
     * 资产数量统计
     *
     * @param searchable belongs 总行或科技公司 categories 固定资产或低值易耗品
     * @param userBean 用户信息
     * @return
     */
    long assetTotalStats(final Searchable searchable, final UserBean userBean);

    /**
     * 批量修改资产锁状态
     */
    void updateLocked(List<String> codes, Boolean locked);

    /**
     * 批量修改资产状态
     */
    void updateStatus(List<String> codes, String status);

    void batchDelete(List<Long> ids);

    void updateAseetCardForSL(long id, String cardNo);

    /**
     * 查询当前用户角色
     */
    Map<String, Object> userRole(UserBean user);

    Workbook exportWorkbook(final Searchable searchable, final String belongs,
            final String categories, final UserBean user);

    /**
     * 定制导出
     */
    Workbook chooseExportWorkbook(final Searchable searchable, final String belongs,
            final String categories, final Long ids, final UserBean user);

    /**
     * 标签资产已经打印过标签
     * 
     * @param assetIdList
     */
    void markLabelPrinted(List<Long> assetIdList);

}
